import time

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager

# 1.打开浏览器驱动管理
ChromeIns = ChromeDriverManager().install()
# 2.创建谷歌浏览器对象
driver = webdriver.Chrome(service=Service(ChromeIns))
#  3.输入网页
# driver.get('https://www.baidu.com')
# time.sleep(1)
# # 4. 查找 进入新导航页
# driver.find_element(By.CSS_SELECTOR, '#kw').send_keys('天行九歌')
# time.sleep(1)
# driver.find_element(By.CSS_SELECTOR, '#su').click()
# time.sleep(2)
# # 4.1 后退
# driver.back()
# time.sleep(2)
# # 4.2 刷新
# driver.refresh()
# time.sleep(2)
# # 4.3 前进
# driver.forward()
# time.sleep(1)
# # 5.关闭浏览器
driver.quit()
